<?php

//Setup
$username = "whatsinvasive"; //flickr user name here
$tagstoignore = array("flickrdate", "zip", "geo:lat", "geo:lon", "geotagged", "shozu", "nolabel", "notvalid", "valid", "invasives", "noninvasives", "oracle", "geolat3406782", "hardinggrass", "perennialpepperweed", "poisonhemlock", "spanishbroom", "terracinaspurge", "yellowstarthistle", "photoerror", "unknownplant");
$mixing = "desc"; // can be random, asc, or desc

// Create new phpFlickr object
//session_start();
require_once($INCLUDE_DIR."phpflickr.helper.php");

//only works if user is rocking a name
if (!empty($username)) {
	
	//Determine NSID and get tag arra
	$nsid = $f->people_findByUsername($username);
	$tog = $f->tags_getListUserPopular($nsid['id'],1000);	
	
	//determine maximum tagcount
	$i = 0;
	foreach($tog as $togo)
	{
		$sizecheckthing[$i] = $togo['count'];
		$i++;
	}
	
	if ($mixing == "random")
	{
		shuffle($tog); //mess up the mix
	}
	elseif ($mixing == "asc")
	{
		sort($tog); //rank starting with lowest popularity
	}
	elseif ($mixing == "desc")
	{
		rsort($tog); //rank starting with highest popularity
	}

	$db = null;
      }
?>

	<div class="bcolor4 leftmenu center">
		<span style="font-size: 1.3em;"><b>User Images<b></span>
	</div>
	<div class="bcolor1 leftmenu">
		<span class="nav"><a href="http://www.flickr.com/photos/<?= $nsid['id'] ?>/tags/hardinggrass/" target="_new"><b>Harding grass</b><br><i>Phalaris aquatica</i></a></span>
	</div>
	<div class="bcolor2 leftmenu">
		<span class="nav"><a href="http://www.flickr.com/photos/<?= $nsid['id'] ?>/tags/perennialpepperweed/" target="_new"><b>Perennial pepperweed</b><br><i>Lepidium latifolium</i></a></span>
	</div>
	<div class="bcolor3 leftmenu">
		<span class="nav"><a href="http://www.flickr.com/photos/<?= $nsid['id'] ?>/tags/poisonhemlock/" target="_new"><b>Poison hemlock</b><br><i>Conium maculatum</i></a></span>
	</div>
	<div class="bcolor5 leftmenu">
		<span class="nav"><a href="http://www.flickr.com/photos/<?= $nsid['id'] ?>/tags/spanishbroom/" target="_new"><b>Spanish Broom</b><br><i>Spartium junceum</i></a></span>
	</div>
	<div class="bcolor1 leftmenu">
		<span class="nav"><a href="http://www.flickr.com/photos/<?= $nsid['id'] ?>/tags/terracinaspurge/" target="_new"><b>Terracina spurge</b><br><i>Euphorbia terracina</i></a></span>
	</div>
	<div class="bcolor2 leftmenu">
		<span class="nav"><a href="http://www.flickr.com/photos/<?= $nsid['id'] ?>/tags/yellowstarthistle/" target="_new"><b>Yellow Starthistle</b><br><i>Centaurea solstitialis</i></a></span>
	</div>
	<div class="bcolor3 leftmenu">
		<span class="nav"><a href="http://www.flickr.com/photos/<?= $nsid['id'] ?>/tags/unknownplant/" target="_new"><b>Unidentified Plants</b></a><br>&nbsp;</span>
	</div>

